﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace StoreHouseA
{
    using StoreHouseDataSetTableAdapters;

    public partial class Form33 : Form
    {
        public Form33()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string old_password = textBox1.Text;
            string new_password = textBox2.Text;
            string re_password = textBox3.Text;
            
            Nullable<int> check = 0;

            if (new_password.Equals(re_password))
            {
                QueriesTableAdapter a = new QueriesTableAdapter();
                a.select_login_check(Program.oman, old_password, ref check);
                if (check == 0)
                {
                    MessageBox.Show("原密码输入错误", "修改密码错误");
                    return;
                }
            }
            else
            {
                MessageBox.Show("新密码与确认密码不符", "修改密码错误");
            }
        }
    }
}
